-
Notifications
You must be signed in to change notification settings - Fork 879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validation round number oracle #3175
Conversation
@@ -127,6 +128,13 @@ interface contract-system-api { | |||
storage-size-delta: u32, | |||
} | |||
|
|||
variant round { | |||
fast, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're in a fast round, should we always fail this oracle call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We kind of do, since oracles are always disabled in fast rounds.
Du you think we should not even expose the variant to contracts? I.e. have a different Round
type in the SDK with one less variant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I suspect we should avoid coupling execution and the BFT internals more than needed here. Perhaps just expose a multi-leader-round
as Option<u32>
? (or u32
and the call fails if there is no such round?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it! That also solves the edge case with the timeout: Whenever we do have to wait for a timeout, it can't be a multi-leader round anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 5361eb2.
Motivation
For most uses of permissionless rounds (#3162), applications need to have access to the round number, at least in multi-leader rounds.
Proposal
Expose the round number in which the block is being validated to the contract.
This is only
Some
in multi-leader rounds.Test Plan
An example application using this will be added in a separate PR.
Release Plan
Links